package BranchBound;

public class Task implements Comparable {
    private int start;
    private int end;
    private int weight;

    public Task(int start, int end, int weight) {
        this.start = start;
        this.end = end;
        this.weight = weight;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    @Override
    public int compareTo(Object o) {
        Task task = (Task) o;
        if (this.end > task.getEnd())
            return 1;
        else if (this.end == task.getEnd())
            return 0;
        else
            return -1;
    }
}
